package com.jie.langlangmall.portal.config;

import com.jie.langlangmall.portal.service.UmsMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.userdetails.UserDetailsService;

/**
 * @Author Jie
 * @Date 2024/11/21 19:20
 * @Email 3217998214@qq.com
 * @Description security模块相关配置
 */
@Configuration
public class LangLangMallSecurityConfig {

    @Autowired
    private UmsMemberService memberService;

    @Bean
    public UserDetailsService userDetailsService() {
        //获取登录用户信息
        return username -> memberService.loadUserByUsername(username);
    }

}
